<%--
  Created by IntelliJ IDEA.
  User: 14811
  Date: 2022-5-1
  Time: 10:08
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="/common/common.jsp"%>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>东东旅游网-我的收藏</title>
  <link href="<%=path%>/css/bootstrap.min.css" rel="stylesheet">
  <link rel="stylesheet" type="text/css" href="<%=path%>/css/common.css">
  <link rel="stylesheet" href="<%=path%>/css/index.css">
  <style>
    .tab-content .row>div {
      margin-top: 16px;
    }
    .tab-content {
      margin-bottom: 36px;
    }
  </style>
  <script>
    function cancelCollect(rid) {
      var uid = ${user.uid};
      //alert(uid+":"+rid)
      $.ajax({
        url:"<%=path%>/collectController/cancelCollect",
        type:"post",
        dataType:"json",
        data:{rid:rid,uid:uid},
        success:function (data) {
          if (data){
            toastr.success("取消收藏成功");
            location.reload();
          }
        }
      })

    }
  </script>
</head>
<body>
<!--引入头部-->
<jsp:include page="header.jsp"/>
<!-- 排行榜 start-->
<section id="content">
  <section class="hemai_jx">
    <div class="jx_top">
      <div class="jx_tit">
        <img src="<%=path%>/images/icon_5.jpg" alt="">
        <span>我的收藏</span>
      </div>
    </div>
    <div class="jx_content">
      <!-- Tab panes -->
      <div class="tab-content">
        <div role="tabpanel" class="tab-pane active" id="home">
          <div class="row">
            <c:forEach items="${pageInfo.result}" var="route">
              <div class="col-md-3">
                <a href="/pageController/toRouteDetail/${route.rid}/${route.sid}">
                  <img src="<%=path%>/file/download?filename=${route.rimage}" alt="" height="156px" width="275px">
                  <div class="has_border">
                    <h3>${route.rname}</h3>
                    <div class="price">网付价<em>￥</em><strong>${route.price}</strong><em>起</em></div>
                  </div>
                </a>
                <a href="javascript:cancelCollect(${route.rid})" style="text-align: center;margin-top: 20px">取消收藏</a>
              </div>

            </c:forEach>

          </div>
        </div>
      </div>
    </div>

      <h4>共${pageInfo.totalPage}页！当前第${pageInfo.pageNumber}页,共${pageInfo.totalCount}条</h4>
      <nav aria-label="Page navigation">
        <ul class="pagination">
          <c:if test="${pageInfo.pageNumber!=1}">
            <li>
              <a href="${pageContext.request.contextPath}/pageController/toMyFavorite?pageNum=${pageInfo.pageNumber-1}" aria-label="Previous">
                <span aria-hidden="true">&laquo;</span>
              </a>
            </li>
          </c:if>

          <c:forEach begin="1" end="${pageInfo.totalPage}" var="i" >
            <li><a href="${pageContext.request.contextPath}/pageController/toMyFavorite?pageNum=${i}">${i}</a></li>
          </c:forEach>

          <c:if test="${pageInfo.pageNumber!=pageInfo.totalPage}">
            <li>
              <a href="${pageContext.request.contextPath}/pageController/toMyFavorite?pageNum=${pageInfo.pageNumber+1}" aria-label="Next">
                <span aria-hidden="true">&raquo;</span>
              </a>
            </li>
          </c:if>

        </ul>
      </nav>
  </section>
</section>
<!-- 排行榜 end-->

<!--引入尾部-->
<div id="footer">
  <jsp:include page="footer.jsp"/>
</div>
<!--导入布局js，共享header和footer-->
</body>
</html>